﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Zzva.UIWin;
using Zzva.DomainObjectReg;

namespace Zzva.AppWin.SoftLicense
{
    public partial class TFrmMain : Form
    {


        private void cmdDirectorySoftType_Click(object sender, EventArgs e)
        {
            DirectorySoftType();
        }


        private void DirectorySoftType()
        {
            try
            {
                TFrmRegDirSoftType lFrmRegDirSoftType;

                TRegDirSoftType lRegDirSoftType;
                lRegDirSoftType = TRegDirSoftType.GetObject();
                lFrmRegDirSoftType = new TFrmRegDirSoftType(lRegDirSoftType);
                //lFrmRegDirSoftType.EventReady += new EventHandler(FrmRegDirSoftType_Ready);
                lFrmRegDirSoftType.ShowDialog();
                lFrmRegDirSoftType.MdiParent = this;

            }

            catch (Exception e1) { MessageBox.Show(e1.Message); }
            finally { }
        }


























































        public TFrmMain()
        {
            InitializeComponent();
        }

        private void cmdDirectoryITCompany_Click(object sender, EventArgs e)
        {
            DirectoryITCompany();
        }

        private void DirectoryITCompany()
        {
            try
            {
                TFrmRegDirITCompany lFrmRegDirITCompany;

                TRegDirITCompany lRegDirITCompany;
                lRegDirITCompany = TRegDirITCompany.GetObject();
                lFrmRegDirITCompany = new TFrmRegDirITCompany(lRegDirITCompany);
                ////lFrmRegDirITCompany.EventReady += new EventHandler(FrmRegDirITCompany_Ready);

                lFrmRegDirITCompany.ShowDialog(); 
                lFrmRegDirITCompany.MdiParent = this;
           

                ////lFrmRegDirITCompany.Show();


            }

            catch (Exception e1) { MessageBox.Show(e1.Message); }
            finally { }
        }

        private void cmdDirectorySoft_Click(object sender, EventArgs e)
        {
            DirectorySoft();
        }


        private void DirectorySoft()
        {
            try
            {
                TFrmRegDirSoftware lFrmRegDirSoftware;

                TRegDirSoftware lRegDirSoftware;
                lRegDirSoftware = TRegDirSoftware.GetObject();
                lFrmRegDirSoftware = new TFrmRegDirSoftware(lRegDirSoftware);
                ////lFrmRegDirSoftware.EventReady += new EventHandler(FrmRegDirSoftware_Ready);
                lFrmRegDirSoftware.ShowDialog();
                lFrmRegDirSoftware.MdiParent = this;


            }

            catch (Exception e1) { MessageBox.Show(e1.Message); }
            finally { }
        }

        private void cmdHelp_Click(object sender, EventArgs e)
        {
            Help();
        }

        private void Help()
        {
            try
            {
                String dir;

                dir = Environment.CurrentDirectory;//получаем текущую рабочую папку приложения
                dir = Application.StartupPath;//получаем папку из которой произошел запуск приложения
                /////dir = Directory.GetCurrentDirectory();
                dir = AppDomain.CurrentDomain.BaseDirectory;


                ////System.Diagnostics.Process.Start(@"E:\Project\Exemple\TestWordDoc.doc");
                System.Diagnostics.Process.Start(dir + @"\ВЛИЕ_238_7_078_ИП.doc");

            }

            catch (Exception e){MessageBox.Show(e.Message);}
            finally { }
        }



    }
}
